package com.mzj.saas.front;

import java.util.List;

import com.haixiaoke.saas.repository.core.AjaxResult;
import com.haixiaoke.saas.repository.core.BaseController;
import com.haixiaoke.saas.repository.core.page.TableDataInfo;
import com.haixiaoke.saas.repository.pojo.Notice;
import com.mzj.saas.util.LoginUserUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.haixiaoke.saas.repository.service.INoticeService;

/**
 * 公众号通知Controller
 *
 * @author qixi
 * @date 2024-03-25
 */
@RestController
@RequestMapping("/front/notice")
public class FrontOpNoticeController extends BaseController {
    @Autowired
    private INoticeService noticeService;


    /**
     * 查询公众号通知列表
     */
    @GetMapping("/list")
    public TableDataInfo userList(Notice notice) {
        startPage();
        List<Notice> list = noticeService.selectNoticeList(notice);
        return getDataTable(list);
    }

    /**
     * 获取公众号通知详细信息
     */
    @GetMapping(value = "/{noticeId}")
    public AjaxResult getInfo(@PathVariable("noticeId") Long noticeId) {
        return success(noticeService.selectNoticeByNoticeId(noticeId));
    }


}
